package com.hk.core.data.jpa.domain;


import com.hk.core.data.jpa.listeners.DelectionEntityListener;
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;


@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper = true)
//@SQLRestriction(value = AuditField.DELETED_STATE_FALSE) // 这个注解在这里配置无效，必须要在具体的子类上
@EntityListeners(value = {DelectionEntityListener.class})
public abstract class AbstractDelectionSnowflakeAuditable extends AbstractSnowflakeAuditable implements DelectionPersistable<Long> {

    /**
     * 删除状态
     */
    @Column(name = DELETED_STATE)
    private Boolean deletedState;

    /**
     * 删除人
     */
    @Column(name = "deleted_by")
    private Long deletedBy;

    /**
     * 删除时间
     */
    @Column(name = "deleted_date")
    private LocalDateTime deletedDate;


}
